public class Solution1758 {
    public int minOperations(String s) {
        int x=0;
        for (int i=0;i<s.length();i++){
            if (s.charAt(i)-'0'==i%2){
                x++;
            }
        }
        return Math.min(x,s.length()-x);
    }

    public static void main(String[] args) {
        System.out.println(new Solution1758().minOperations("0100"));
    }
}
